/*jshint unused: vars */
define([
    'angular',
    'angular-couch-potato',
    'ui.router',
    'oc.lazyLoad',
    "customLazyLoader",
    'routingConfig',
    'controllers/index',
    'filters/index',
    'services/index',
    'directives/index'
  ]/*deps*/,
  function (angular, couchPotato, uiRoute, ocLazyLoad, lazyLoader)/*invoke*/ {
    'use strict';

    /**
     * @ngdoc overview
     * @name h3gClientApp
     * @description
     * # h3gClientApp
     *
     * Main module of the application.
     */
    var app = angular.module('h3gClientApp', [
        'h3gClientApp.controllers',
        'h3gClientApp.services',
        'h3gClientApp.filters',
        'h3gClientApp.directives',
        //'h3gClientApp.base',
        /*angJSDeps*/
        'ngCookies',
        'ngAria',
        'ngMessages',
        'ngResource',
        'ngSanitize',
        'ngRoute',
        'ngAnimate',
        'ngTouch',
        'ui.router',
        'oc.lazyLoad',
        'ncy-angular-breadcrumb',
        'scs.couch-potato'
      ]);
    couchPotato.configureApp(app);
    app.config(['$ocLazyLoadProvider', function ($ocLazyLoadProvider) {
      $ocLazyLoadProvider.config({
        jsLoader: requirejs,
        debug: true
      });
    }])
    app.run(function ($rootScope, $state, $stateParams, PageData) {
      $rootScope.pageData = PageData;
      $rootScope.appName = 'h3g'
      $rootScope.$state = $state;
      $rootScope.$stateParams = $stateParams;
      $rootScope.setting = {
        title: 'home'
      }
      $rootScope.getSetting = function (key) {
        return $rootScope.setting[key]
      }
      require(['demo'], function () {
        console.log('inited demo');
      });
    });
    return app;
  });
